package com.mlnx.service.base.config;

import com.mlnx.service.base.properties.MutilDeviceProperties;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by amanda.shan on 2019/10/25.
 */
@Configuration
public class PoolConfig {

    @Autowired
    private MutilDeviceProperties mutilDeviceProperties;

    // 广播消息线程池
    @Bean
    public ExecutorService broadCastExecutorService(){
        return Executors.newFixedThreadPool(mutilDeviceProperties.getStream().getBroadCastPoolSize());
    }
}
